/********************************************************/
/*	Copyright (C) 2016 Gong Li Bin		 	*/
/*	Project:	GlbRtbEng-1.0.0			*/
/*	Author:		gong_libin			*/
/*	Date:		2016_06_26			*/
/*	File:		GlbRtbAdvsTest.cpp		*/
/********************************************************/

#include "GlbRtbAdvs.h"

int main(int argc, char* argv[])
{
	UINT uiCount = 0;
	CGlbRtbAdvs CAdvs;
	GlbCls::CGlbSet* pCSet = NULL;
	char szXml[] = "/root/GlbRtbConf-1.0.0/GlbRtbAdvs.xml";

	if (GLB_SUCCESS == CAdvs.GlbRtbBaseCreate(ftok(GLB_RA_PATH, GLB_RA_KEY), GLB_RA_SUM, GLB_RA_SIZE, GlbRtbAdvsComp)) {
		CAdvs.GlbRtbBaseReset(GLB_RA_SUM);
		CAdvs.GlbRtbBaseInput((void*)szXml);
		pCSet = CAdvs.GlbRtbBaseGetPtr();
		while (uiCount < pCSet->GlbSetGetCount()) {
			GLB_PRINT("Count[%04d]:\n", uiCount + 1);
			GlbRtbAdvsPrint((GLBRAINFO_S*)pCSet->GlbSetIndexGet(uiCount ++));
			GLB_PRINT("\n");
		}
		CAdvs.GlbRtbBaseDelete();
	}
	else {
		GLB_ERROR("Failed to GlbRtbBaseCreate\n");
	}

	return GLB_SUCCESS;
}
